<?php 
require_once dirname(__FILE__) . '/__config.php';
require_once dirname(__FILE__) . '/incls/php/miscutils.class.php';
require_once dirname(__FILE__) . '/incls/php/dbutils.class.php';
$myPdo = DbUtils::createPdoInst();

$sql = "CREATE TABLE IF NOT EXISTS `pz2_mv`(
         `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
         `title` varchar(128) DEFAULT '',
         `year` smallint(6) DEFAULT 0,
         `rated` varchar(16) DEFAULT '',
         `runtime` varchar(16) DEFAULT '',
         `genre` varchar(256) DEFAULT '',
         `director` varchar(256) DEFAULT '',
         `writer` varchar(256) DEFAULT '',
         `actors` varchar(1024) DEFAULT '',
         `plot` varchar(2048) DEFAULT '',
         `poster` varchar(256) DEFAULT '',
         `imdbrating` float DEFAULT 0.0,
         `imdbvotes` int DEFAULT 0,
         `imdbid` varchar(16) DEFAULT '',
         `type` varchar(16) DEFAULT '',
         `folder` varchar(128) UNIQUE DEFAULT ''
        ) ENGINE=MYISAM;";
$myPdo->exec($sql);

$sql = "CREATE TABLE IF NOT EXISTS `pz2_genre`(
         `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
         `name` varchar(128) UNIQUE DEFAULT ''
        ) ENGINE=MYISAM;";
$myPdo->exec($sql);

$sql = "CREATE TABLE IF NOT EXISTS `pz2_director`(
         `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
         `name` varchar(128) UNIQUE DEFAULT ''
        ) ENGINE=MYISAM;";
$myPdo->exec($sql);

$sql = "CREATE TABLE IF NOT EXISTS `pz2_writor`(
         `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
         `name` varchar(128) UNIQUE DEFAULT ''
        ) ENGINE=MYISAM;";
$myPdo->exec($sql);

$sql = "CREATE TABLE IF NOT EXISTS `pz2_actor`(
         `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
         `name` varchar(128) UNIQUE DEFAULT ''
        ) ENGINE=MYISAM;";
$myPdo->exec($sql);
?>